<template>
  <view class="oderPage">
    <view class="head" :style="[{ height: customBar + 'px' }]">
      <u-navbar
        title="订单详情"
        :autoBack="true"
        :titleStyle="{ fontSize: '34rpx', fontWeight: '500' }"></u-navbar>
    </view>
    <view class="">
      <view class="reservationList">
        <view class="reservationLeft">
          <image class="img" :src="HTTP_IMG_URL() + parmas.activity.images"></image>
        </view>
        <view class="reservationRight">
          <view class="reservationName">{{ parmas.activity.name }}</view>
          <!-- <view class="reservationLable">
            <view class="label_green">羽毛球</view>
            <view class="label_green">网球</view>
            <view class="label_green">网球</view>
          </view> -->
          <view class="status" v-if="parmas.status == '1'">待使用</view>
          <view class="status1" v-if="parmas.status == '2'">已完成</view>
        </view>
      </view>
    </view>
    <view class="priceDetail">
      <view class="title">订单详情</view>
      <view class="list">
        <view>订单编号</view>
        <view>{{ parmas.order_no }}</view>
      </view>
      <view class="list">
        <view>预约时间</view>
        <view>{{ parmas.paytime_text }}</view>
      </view>
      <view class="list">
        <view>订单金额</view>
        <view style="color: #fd463e">{{ parmas.score_fee }}积分</view>
      </view>
    </view>

    <view class="sure" v-if="parmas.status == '1'">取消预约</view>
  </view>
</template>

<script>
import { mapGetters } from "vuex";
import { HTTP_IMG_URL } from "../../config/app.js";
export default {
  data() {
    return {
      customBar: 88,
      jfVal: "",
      parmas: "",
    };
  },
  computed: mapGetters(["isLogin", "uid", "userInfo"]),
  onLoad(parmas) {
    console.log(parmas);
    this.parmas = JSON.parse(parmas.data);
    console.log(this.parmas);
  },
  methods: {
    HTTP_IMG_URL() {
      return HTTP_IMG_URL;
    },
    groupChange(n) {
      console.log("groupChange", n);
    },
  },
};
</script>

<style lang="scss">
.oderPage {
  height: 100%;
  min-height: 100vh;
  font-family: PingFang SC;
  background: #f5f5f4;
  padding: 0 32rpx;
  padding-bottom: calc(env(safe-area-inset-bottom) / 2);
  .reservationList {
    width: 100%;
    background: #ffffff;
    box-shadow: 0rpx 0rpx 12rpx 0rpx rgba(0, 0, 0, 0.1),
      inset 0rpx 2rpx 2rpx 0rpx #ffffff;
    border-radius: 28rpx;
    margin-bottom: 20rpx;
    display: flex;
    padding: 20rpx 22rpx;
    box-sizing: border-box;
    margin-top: 20rpx;
    .reservationLeft {
      width: 156rpx;
      height: 156rpx;
      background: #ffffff;
      border-radius: 28rpx;
      .img {
        width: 156rpx;
        height: 156rpx;
      }
    }
    .reservationRight {
      margin-left: 20rpx;

      width: 100%;

      .reservationName {
        font-weight: 500;
        font-size: 32rpx;
      }
      .reservationLable {
        display: flex;
        margin-top: 8rpx;
        flex-wrap: wrap;

        .label_green {
          padding: 5rpx 20rpx;
          color: #a3c616;
          background: rgba(163, 198, 22, 0.2);
          border-radius: 40rpx;
          font-size: 24rpx;
          margin-right: 10rpx;
          margin-top: 10rpx;
        }
      }
    }
    .status {
      font-family: SourceHanSansCN, SourceHanSansCN;
      font-weight: 500;
      font-size: 30rpx;
      color: #fd463e;
      margin-top: 18rpx;
    }
    .status1 {
      font-family: SourceHanSansCN, SourceHanSansCN;
      font-weight: 500;
      font-size: 30rpx;
      color: #9a9a9a;
      margin-top: 18rpx;
    }
  }
  .priceDetail {
    width: 100%;
    background: #ffffff;
    border-radius: 28rpx;
    box-shadow: 0rpx 0rpx 12rpx 0rpx rgba(0, 0, 0, 0.1),
      inset 0rpx 2rpx 2rpx 0rpx #ffffff;
    margin-top: 20rpx;
    padding: 30rpx;
    box-sizing: border-box;
    .title {
      font-size: 32rpx;
      border-bottom: 1px #e6e5e5 solid;
      padding-bottom: 28rpx;
    }
    .u-radio-group--row {
      display: block;
    }
    .list {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 28rpx;
      margin-top: 26rpx;
      .name {
        display: flex;
        align-items: center;
      }
      .img {
        width: 52rpx;
        margin-right: 16rpx;
      }
    }
  }

  .sure {
    width: 100%;
    height: 88rpx;
    font-family: PingFangSC, PingFang SC;
    font-weight: 500;
    font-size: 34rpx;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #a3c616;
    box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(163, 198, 22, 0.3);
    border-radius: 24rpx;
    margin-top: 140rpx;
  }
}
</style>
